package com.escool.model;

// Generated Dec 12, 2012 8:20:30 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbSede generated by hbm2java
 */
@Entity
@Table(name = "tb_sede")
public class TbSede implements java.io.Serializable {

	private Integer idSede;
	private TbColegio tbColegio;
	private TbProvincia tbProvincia;
	private String nombreSede;
	private String direccionSede;
	private String telSede;
	private Set<TbSedeHasSeccion> tbSedeHasSeccions = new HashSet<TbSedeHasSeccion>(
			0);
	private Set<TbSedeHasPersonal> tbSedeHasPersonals = new HashSet<TbSedeHasPersonal>(
			0);

	public TbSede() {
	}

	public TbSede(TbColegio tbColegio, TbProvincia tbProvincia,
			String nombreSede, String direccionSede) {
		this.tbColegio = tbColegio;
		this.tbProvincia = tbProvincia;
		this.nombreSede = nombreSede;
		this.direccionSede = direccionSede;
	}

	public TbSede(TbColegio tbColegio, TbProvincia tbProvincia,
			String nombreSede, String direccionSede, String telSede,
			Set<TbSedeHasSeccion> tbSedeHasSeccions,
			Set<TbSedeHasPersonal> tbSedeHasPersonals) {
		this.tbColegio = tbColegio;
		this.tbProvincia = tbProvincia;
		this.nombreSede = nombreSede;
		this.direccionSede = direccionSede;
		this.telSede = telSede;
		this.tbSedeHasSeccions = tbSedeHasSeccions;
		this.tbSedeHasPersonals = tbSedeHasPersonals;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_sede", unique = true, nullable = false)
	public Integer getIdSede() {
		return this.idSede;
	}

	public void setIdSede(Integer idSede) {
		this.idSede = idSede;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "tb_colegio_id_colegio", nullable = false)
	public TbColegio getTbColegio() {
		return this.tbColegio;
	}

	public void setTbColegio(TbColegio tbColegio) {
		this.tbColegio = tbColegio;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "tb_provincia_id_provincia", nullable = false)
	public TbProvincia getTbProvincia() {
		return this.tbProvincia;
	}

	public void setTbProvincia(TbProvincia tbProvincia) {
		this.tbProvincia = tbProvincia;
	}

	@Column(name = "nombre_sede", nullable = false, length = 45)
	public String getNombreSede() {
		return this.nombreSede;
	}

	public void setNombreSede(String nombreSede) {
		this.nombreSede = nombreSede;
	}

	@Column(name = "direccion_sede", nullable = false, length = 256)
	public String getDireccionSede() {
		return this.direccionSede;
	}

	public void setDireccionSede(String direccionSede) {
		this.direccionSede = direccionSede;
	}

	@Column(name = "tel_sede", length = 15)
	public String getTelSede() {
		return this.telSede;
	}

	public void setTelSede(String telSede) {
		this.telSede = telSede;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbSede")
	public Set<TbSedeHasSeccion> getTbSedeHasSeccions() {
		return this.tbSedeHasSeccions;
	}

	public void setTbSedeHasSeccions(Set<TbSedeHasSeccion> tbSedeHasSeccions) {
		this.tbSedeHasSeccions = tbSedeHasSeccions;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbSede")
	public Set<TbSedeHasPersonal> getTbSedeHasPersonals() {
		return this.tbSedeHasPersonals;
	}

	public void setTbSedeHasPersonals(Set<TbSedeHasPersonal> tbSedeHasPersonals) {
		this.tbSedeHasPersonals = tbSedeHasPersonals;
	}

}
